<template>
  <div>
    <!-- 面包屑导航 -->
    <div class="fz15 fw">系统设置</div>
    <!-- 分割线 -->
    <el-divider></el-divider>
    <el-row>
      <el-col :span="8">
        <el-form :model="form">
          <el-form-item label="系统名称：" label-width="100px">
            <el-input
              style="width: 300px"
              v-model="form.system_name"
            ></el-input>
          </el-form-item>
          <el-form-item label="后台名称：" label-width="100px">
            <el-input
              style="width: 300px"
              v-model="form.backstage_name"
            ></el-input>
          </el-form-item>
          <el-form-item label="软件署名：" label-width="100px">
            <el-input style="width: 300px" v-model="form.sign_name"></el-input>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
    <el-row>
      <div
        class="fz14"
        style="line-height: 32px; color: #606266; margin-left: 20px"
      >
        短信参数：
      </div>
      <el-col :span="4">
        <el-form :model="form">
          <el-form-item label="端口" label-width="80px">
            <el-input style="width: 300px" v-model="form.port"></el-input>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="4">
        <el-form :model="form">
          <el-form-item label="波特率" label-width="80px">
            <el-input style="width: 300px" v-model="form.bt"></el-input>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="4">
        <el-form :model="form">
          <el-form-item label="奇偶校验" label-width="80px">
            <el-input style="width: 300px" v-model="form.jou"></el-input>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="4">
        <el-form :model="form">
          <el-form-item label="停止位" label-width="80px">
            <el-input style="width: 300px" v-model="form.tz"></el-input>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="8">
        <el-form :model="form">
          <el-form-item label="下井人数预警" label-width="115px">
            <el-input style="width: 300px" v-model="form.people"></el-input>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="8">
        <el-form-item label-width="20px">
          <el-button type="primary" @click="onConfirm">确认</el-button>
        </el-form-item>
      </el-col>
    </el-row>
  </div>
</template>
<script setup>
import { ElMessage } from "element-plus";
import { reactive, ref, onMounted } from "vue";
import httpApis from "../../http/index";
const dialogFormVisible = ref(false);
const open2 = () => {
  ElMessage({
    message: "添加成功",
    type: "success",
  });
};
const form = ref({
  system_name: "xxx数据巡检系统",
  backstage_name: "xxx数据巡检后台管理系统",
  sign_name: "创脉信息科技研发设计",
  port: "COM2",
  bt: "9600",
  jou: "None",
  tz: "0",
  people: "398",
});
//确认修改
function onConfirm() {
  //将系统数据保存在本地存储
  localStorage.setItem("system_info", JSON.stringify(form.value));
  open2();
}
onMounted(() => {
  if (localStorage.getItem("system_info") !== null) {
    form.value = JSON.parse(localStorage.getItem("system_info"));
    console.log(form.value);
  }
});
</script>

<style lang="scss" scoped>
.net-box {
  svg {
    display: none;
  }
  &:hover svg {
    display: block;
  }
}
</style>

